io.output():setvbuf('no')
display.setStatusBar( display.HiddenStatusBar )

BASE_SCREEN_WIDTH = 320
BASE_SCREEN_HEIGHT = 480
AUDIO_ENABLED = true

print("Fonts")
local sysFonts = native.getFontNames()
for k,v in pairs(sysFonts) do print(v) end

gameCenter = require "GameCenter"

LEVEL_SAVE_FILE = "level_save" 
HIGH_SCORE_SAVE_FILE = "high_score" 
LAST_LEVEL = 30

global_levelNumber = 1

-- Don't forget to calc the highscore
global_totalHighScore = 0


local storyboard = require "storyboard"
local persistence = require "Persistence" 
local level = tonumber(persistence.loadValue(LEVEL_SAVE_FILE))

gameCenter.startGameCenter()


if (level ~= 0 ) then
	global_levelNumber = level
	--persistence.saveValue(HIGH_SCORE_SAVE_FILE..global_levelNumber,0)
	
end

print("High Score ".. global_totalHighScore)
print("Saved level " .. global_levelNumber)
--global_totalHighScore = persistence.loadValue(HIGH_SCORE_SAVE_FILE)

storyboard.gotoScene("splash1")
